<?php

namespace App\Services;

use App\Consts\ExceptionCode;
use App\Consts\GlobalLoginConst;

class LogLoginService extends BaseService
{
    public function getLoginErrorLoadData($params)
    {
        return [
            'user_id' => $params['user_id'],
            'access_token' => $params['access_token'],
            'input_login_name' => $params['input_login_name'],
            'login_type' => $params['login_type'],
            'platform' => GlobalLoginConst::LOGIN_PLATFORM_WEB,
            'code' => $params['code'],
            'ip' => request()->getClientIp(),
        ];
    }

    public function getLoginSuccesLoadData($params)
    {
        return [
            'user_id' => $params['user_id'],
            'access_token' => $params['access_token'],
            'input_login_name' => $params['input_login_name'],
            'login_type' => $params['login_type'],
            'platform' => GlobalLoginConst::LOGIN_PLATFORM_WEB,
            'code' => ExceptionCode::OPERATING_SUCCESS,
            'ip' => request()->getClientIp(),
        ];
    }
}
